package collection;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

public class SetDemo {
    public static void main(String[] args) {
        Set<Point>s=new LinkedHashSet<>();
       // Set<Point>s=new HashSet<>();//
        s.add(new Point(1,2));
        s.add(new Point(2,3));
        s.add(new Point(3,4));
        s.add(new Point(4,5));

        s.add(new Point(1,2));
        System.out.println(s);


        boolean b=s.add(new Point(3,4));
        System.out.println(b);
        System.out.println(s);
    }
}
